//
//  OtherCostDetailVC.m
//  KuWoCan
//
//  Created by hwd on 17/4/12.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "OtherCostDetailVC.h"
#import "DoubleLabCell.h"
#import "BottomDoubleBtnView.h"
#import "NWSaleApplyRequest.h"
#import "CargoCell.h"
#import "PhotoManageCell.h"
#import "NWPicManageRequest.h"
#import "OtherCostCommitVC.h"
#import "PicPageListModel.h"
#import "SelfTextView.h"
#import "OtherCostListModel.h"



@interface OtherCostDetailVC ()<UITableViewDelegate,UITableViewDataSource,UIAlertViewDelegate>
{
    SelfTextView *inputTV;//核销输入框
}

@property (nonatomic,strong) NSArray *detailInfoArr;

@property (nonatomic,strong) NSArray *recordListArr; //审批信息数组

@property (nonatomic,strong) OtherCostListModel *detailModel;

@property (nonatomic,strong) TPKeyboardAvoidingTableView *tabView;

@property (nonatomic,strong) UIAlertView *deleteAlert;

@property (nonatomic,strong) NSMutableArray *pics; //照片数组

@property (nonatomic,assign) SAQueryStatus orderStatus;

@property (nonatomic,strong) NSString *mbContent;//核销标准

@property (nonatomic,strong)UIView *heXiaoview;//核销View
@property (nonatomic,strong)BottomDoubleBtnView *btnsView;//拒绝 通过按钮

@property (nonatomic,strong) NSMutableArray *picHXArr;
@property (nonatomic,strong)UIButton *deleteBtn;

@end

@implementation OtherCostDetailVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    _pics = [[NSMutableArray alloc]init];
    _picHXArr = [[NSMutableArray alloc]init];
    _mbContent = @"";
    if (self.moduleType == HomeModuleTypeOA) {
        self.title = @"其他费用申请";
    } else {
        self.title = @"其他费用核销";
    }
    [self getData];
    
}

- (void)getData
{
    
    NWPicManageRequest *picRequest = [[NWPicManageRequest alloc] init];
    [picRequest startRequestQueryPicWithProcessId:_orderId pageNo:@"1" pageSize:@"10" type:[NSString stringWithFormat:@"%zd", _moduleType == HomeModuleTypeOA?PicTypeOtherFeeAdd:12]];
    [picRequest completion:^(id result, NSString *message, id extension, BOOL succ) {
        if (succ)
        {
            PicPageListModel *pageModel = [[PicPageListModel alloc] initWithDictionary:result[@"pageList"] error:nil];
            if ([pageModel.count integerValue] > 0)
            {
                _pics = pageModel.list.mutableCopy;
            }
            
        }
        [self getHXPicData];
    }];

  }
-(void)getHXPicData
{
    NWPicManageRequest *picRequest = [[NWPicManageRequest alloc] init];
    [picRequest startRequestQueryPicWithProcessId:_orderId pageNo:@"1" pageSize:@"10" type:[NSString stringWithFormat:@"%zd", 10]];
    [picRequest completion:^(id result, NSString *message, id extension, BOOL succ) {
        if (succ)
        {
            PicPageListModel *pageModel = [[PicPageListModel alloc] initWithDictionary:result[@"pageList"] error:nil];
            if ([pageModel.count integerValue] > 0)
            {
                self.picHXArr = pageModel.list.mutableCopy;
            }
            
        }
         [self addOtherRequest];
    }];
    
}

-(void)addOtherRequest
{
    NWSaleApplyRequest *request = [[NWSaleApplyRequest alloc] init];
    if (_moduleType == HomeModuleTypeOA)
    {
        [request startRequestOtherApplyDetailWithId:_orderId];
    }
    else
    {
        [request startRequestOtherCheckDetailWithId:_orderId];
    }
    [request completion:^(id result, NSString *message, id extension, BOOL succ) {
        if (succ)
        {
            //这里做数据解析
            _detailModel = [[OtherCostListModel alloc] initWithDictionary:result[@"data"] error:nil];
            _recordListArr = [OtherDetailCheckListModel arrayOfModelsFromDictionaries:_detailModel.approvalList];
            
            if (_pics.count>0 )
            {
               _detailModel.photoList = _pics.copy;
            }
            if (_moduleType == HomeModuleTypeOA)
            {
                _orderStatus = [_detailModel.approvalStatus integerValue];
            }
            else
            {
                _orderStatus = [_detailModel.examineStatus integerValue];
            }
            _mbContent = [ToolViewViewController GetDataStr:_detailModel.mbContent];
            _detailInfoArr = @[@{@"主旨":_detailModel.title?:@""},@{@"内容及形式":_detailModel.explains?:@""},@{@"费用总计":_detailModel.costs?:@""}];
            [self setUpUI];
        }
    }];

}
- (void)reloadData {
    NWSaleApplyRequest *request = [[NWSaleApplyRequest alloc] init];
    if (_moduleType == HomeModuleTypeOA)
    {
        [request startRequestOtherApplyDetailWithId:_orderId];
    }
    else
    {
        [request startRequestOtherCheckDetailWithId:_orderId];
    }
    [request completion:^(id result, NSString *message, id extension, BOOL succ) {
        if (succ)
        {
            //这里做数据解析
            _detailModel = [[OtherCostListModel alloc] initWithDictionary:result[@"data"] error:nil];
            _recordListArr = [OtherDetailCheckListModel arrayOfModelsFromDictionaries:_detailModel.approvalList];

            if (_moduleType == HomeModuleTypeOC)
            {
                _pics = _detailModel.photoList.mutableCopy;
            }

            if (_moduleType == HomeModuleTypeOA)
            {
                _orderStatus = [_detailModel.approvalStatus integerValue];
            }
            else
            {
                _orderStatus = [_detailModel.examineStatus integerValue];
            }
            
            _mbContent = [ToolViewViewController GetDataStr:_mbContent];
            _detailInfoArr = @[@{@"主旨":_detailModel.title?:@""},@{@"内容及形式":_detailModel.explains?:@""},@{@"费用总计":_detailModel.costs?:@""}];
            [self.tabView reloadData];
        } else {
            [SVProgressHUD showErrorWithStatus:message];
        }
    }];
}
//修改按钮,先判断是否是自己的订单
//如果是自己订单,待提交  待审批状态下  有修改按钮
- (void)createChangeBtn
{
    if ([[Singleton shareInstance].userType integerValue] == UserTypeAgency)
    {
        if ([_detailModel.userId isEqualToString:[Singleton shareInstance].userId])
        {
            if (_orderStatus == SAQueryStatusToSubmit || _orderStatus == SAQueryStatusToAudit)
            {
                [self createRightButton:@"修改" selector:@selector(changeInfo)];
            }
        }
    }
}

- (void)changeInfo
{
    OtherCostCommitVC *vc = [[OtherCostCommitVC alloc] init];
    vc.isChangeInfo = YES;
    vc.isSubmit = _isSubmit;
    vc.detailInfoModel = _detailModel;
    vc.orderStatus = [NSString stringWithFormat:@"%ld",(long)_orderStatus];
    vc.orderId = _orderId;
    vc.moduleType = _moduleType;
    vc.reloadBlock = ^{
        [self getData];
    };
    [self.navigationController pushViewController:vc animated:YES];
}

- (void)createBottomView
{
    //这里创建底部操作按钮,先要判断是否是本人的订单,如果是在判断自己的身份,显示对应按钮
    //是本人订单
    //根据订单状态来显示底部按钮
    if ([[Singleton shareInstance].userType integerValue] == UserTypeAgency)
    {
        if ([_detailModel.userId isEqualToString:[Singleton shareInstance].userId])
        {
            if (_moduleType == HomeModuleTypeOA)
            {
                if (_orderStatus == SAQueryStatusToAudit || _orderStatus == SAQueryStatusToSubmit)
                {
                    [self createBottomBtnWithTitle:@"删除"];
                }
                else if (_orderStatus == SAQueryStatusCompleted)
                {
                    [self createBottomBtnWithTitle:@"确认查看"];
                }
                else
                {
                    [_tabView mas_updateConstraints:^(MASConstraintMaker *make) {
                        make.bottom.equalTo(@0);
                    }];
                }
            }
            else if (_moduleType == HomeModuleTypeOC) {
                if (_orderStatus == SAQueryStatusToSubmit) {
                    [self createSubmitButton];
                } else {
                    [_tabView mas_updateConstraints:^(MASConstraintMaker *make) {
                        make.bottom.equalTo(@0);
                    }];
                }
            }
        }
    }
    else
    {
        if ([_detailModel.approverUser isEqualToString:[Singleton shareInstance].userId])
        {
            if(_orderStatus == SAQueryStatusToAudit)
            {
                [self createDoubleBtnsView];
            }
            else if (_orderStatus == SAQueryStatusAuditting || _orderStatus == SAQueryStatusPlanningDepartment || _orderStatus == SAQueryStatusMarketingCenter)
            {
                [self createDoubleBtnsView];
            }
            else
            {
                [_tabView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.bottom.equalTo(@0);
                }];
            }
        }
        else
        {
            [_tabView mas_updateConstraints:^(MASConstraintMaker *make) {
                make.bottom.equalTo(@0);
            }];
        }
    }
}

- (void)createBottomBtnWithTitle:(NSString *)title
{
    _deleteBtn = [UIButton buttonWithType:UIButtonTypeSystem];
    [_deleteBtn setBackgroundColor:KwBlueColor];
    [_deleteBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [_deleteBtn setTitle:title forState:UIControlStateNormal];
    _deleteBtn.titleLabel.font = KwFont(16.0);
    [_deleteBtn addTarget:self action:@selector(deleteOrder:) forControlEvents:UIControlEventTouchUpInside];
    _deleteBtn.layer.masksToBounds = YES;
    _deleteBtn.layer.cornerRadius = 5.0;
    [self.view addSubview:_deleteBtn];
    [_deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(@-5);
        make.top.equalTo(_tabView.mas_bottom).offset(1);
        make.left.equalTo(@5);
        make.right.equalTo(@-5);
    }];
}

- (void)createDoubleBtnsView
{
    //拒绝  通过
    _btnsView = [[BottomDoubleBtnView alloc] init];
    _btnsView.orderId = _orderId;
    _btnsView.orderStatus = [NSString stringWithFormat:@"%ld",(long)_orderStatus];
    _btnsView.moduleType = _moduleType;
    _btnsView.mbContent = [ToolViewViewController GetDataStr:_mbContent];
    [self.view addSubview:_btnsView];
    [_btnsView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(@-5);
        make.top.equalTo(_tabView.mas_bottom).offset(1);
        make.left.equalTo(@5);
        make.right.equalTo(@-5);
    }];
}

- (void)createSubmitButton {
    UIButton *confirmBtn = [UIButton buttonWithType:UIButtonTypeSystem];
    [confirmBtn setBackgroundColor:KwBlueColor];
    [confirmBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [confirmBtn setTitle:@"提交" forState:UIControlStateNormal];
    confirmBtn.titleLabel.font = KwFont(16.0);
    [confirmBtn addTarget:self action:@selector(submitOrder) forControlEvents:UIControlEventTouchUpInside];
    confirmBtn.layer.masksToBounds = YES;
    confirmBtn.layer.cornerRadius = 5.0;
    [self.view addSubview:confirmBtn];
    [confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(@-5);
        make.top.equalTo(_tabView.mas_bottom).offset(1);
        make.left.equalTo(@5);
        make.right.equalTo(@-5);
    }];
}

- (void)deleteOrder:(UIButton *)btn
{
    if ([btn.titleLabel.text isEqualToString:@"确认查看"]) {
        [HttpRequest PostrequestUrl:[NSString stringWithFormat:@"%@/jeesite/interface/appOtherApplication/userConfirm",baseUrlMe] Dic:@{@"id":[ToolViewViewController isNotNullStr:_orderId]?_orderId:@"",@"approvalStatus":@"6"} completion:^(NSDictionary *responseDic) {
            if ([responseDic[@"success"] boolValue]) {
                [_deleteBtn removeFromSuperview];
                [self getData];
               
            }else
            {
                [SVProgressHUD showErrorWithStatus:@"确认失败"];
            }
            
        }];
    }else
    {
        _deleteAlert = [[UIAlertView alloc]initWithTitle:@"提示" message:@"确定删除？" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
        [_deleteAlert show];

    }
}

- (void)submitOrder {
    NWSaleApplyRequest *request = [[NWSaleApplyRequest alloc] init];

    NSMutableDictionary *paramete = [NSMutableDictionary dictionary];
    [paramete setObject:_orderId forKey:@"id"];
    [paramete setObject:[Singleton shareInstance].userId forKey:@"user.id"];
    [paramete setObject:_detailModel.title forKey:@"title"];
    [paramete setObject:_detailModel.explains forKey:@"explains"];
    [paramete setObject:_detailModel.costs forKey:@"costs"];
    [paramete setObject:@"1" forKey:@"examineStatus"];
    [paramete setObject:@"0" forKey:@"approvalType"];

    [request startRequestUpdateOtherCheckWithDic:paramete];
    [request completion:^(id result, NSString *message, id extension, BOOL succ) {
        if (succ) {
            [SVProgressHUD showSuccessWithStatus:@"提交成功"];
            [self.navigationController popViewControllerAnimated:YES];
        }
    }];

}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (alertView == _deleteAlert)
    {
        if (buttonIndex == 1)
        {
            NWSaleApplyRequest *request = [[NWSaleApplyRequest alloc] init];
            [request startRequestDeleteApplyOrCheckWithId:_orderId moduleType:_moduleType];
            [request completion:^(id result, NSString *message, id extension, BOOL succ) {
                if (succ)
                {
                    [SVProgressHUD showSuccessWithStatus:@"删除成功"];
                    [self.navigationController popViewControllerAnimated:YES];
                }
            }];
        }
    }
}

- (void)setUpUI
{
    [self createChangeBtn];

    //创建列表
    _tabView = [[TPKeyboardAvoidingTableView alloc] initWithFrame:CGRectMake(0, 0, 0, 0) style:UITableViewStyleGrouped];
    _tabView.separatorStyle = UITableViewCellSeparatorStyleNone;
    _tabView.estimatedRowHeight = 40.0;
    _tabView.rowHeight = UITableViewAutomaticDimension;
    _tabView.delegate = self;
    _tabView.dataSource = self;
    [self.view addSubview:_tabView];
    [_tabView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(@0);
        make.left.right.equalTo(@0);
        make.bottom.equalTo(@-55);
    }];

    [self createBottomView];
}

#pragma mark tableViewDelegate,DataSource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    if (_moduleType == HomeModuleTypeOA)
    {
        return 3;
    }
    else
    {
        return 4;
    }
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{

    if ([_detailModel.approverUser isEqualToString:[Singleton shareInstance].userId] && section == 2 && _orderStatus == 1 && _moduleType == HomeModuleTypeOA) {
        return 190*screenH_6;
    }else if ([ToolViewViewController isNotNullStr:_mbContent] )
    {
        if ((_moduleType == HomeModuleTypeOA && section == 2 ) || (_moduleType == HomeModuleTypeOC && section == 3))
        {
            return 90*screenH_6 + [TomamaUI getStringHeightWith:_mbContent andWeith:SCREENW-150*screenW_6 andFont:[UIFont systemFontOfSize:14*screenH_6]];
        }
    }
    return 0.00001;
}
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    if (([_detailModel.approverUser isEqualToString:[Singleton shareInstance].userId] && section == 2 && _orderStatus == 1 && _moduleType == HomeModuleTypeOA) || [ToolViewViewController isNotNullStr:_mbContent]) {
        return self.heXiaoview;
    }
    else if ([ToolViewViewController isNotNullStr:_mbContent] )
    {
        if ((_moduleType == HomeModuleTypeOA && section == 2 ) || (_moduleType == HomeModuleTypeOC && section == 3))
        {
            return self.heXiaoview;
        }
    }
    return [[UIView alloc]initWithFrame:CGRectZero];
}
-(UIView *)heXiaoview
{
    if (!_heXiaoview) {
        _heXiaoview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREENW, [ToolViewViewController isNotNullStr:_mbContent]?[TomamaUI getStringHeightWith:_mbContent andWeith:SCREENW-150*screenW_6 andFont:[UIFont systemFontOfSize:14*screenH_6]]+90*screenH_6:190*screenW_6)];
        _heXiaoview.backgroundColor = [UIColor whiteColor];
        
        [_heXiaoview addSubview:[ToolViewViewController addCellLineLab:CGRectMake(0, 0, SCREENW, 1*screenH_6)]];
        //标题
        UILabel *titleLab = [TomamaUI createLabel:CGRectMake(25*screenW_6,15*screenW_6,SCREENW-150*screenW_6,25*screenW_6) textAligment:0 font:[UIFont systemFontOfSize:15*screenW_6] textColor:[UIColor colorWithHexString:@"#333333"] text:@"核销标准"];
        [_heXiaoview addSubview:titleLab];
        
        //输入框
        inputTV = [[SelfTextView alloc]initWithFrame:CGRectMake(20*screenW_6, 50*screenW_6, SCREENW-40*screenW_6,[ToolViewViewController isNotNullStr:_mbContent]?[TomamaUI getStringHeightWith:_mbContent andWeith:SCREENW-150*screenW_6 andFont:[UIFont systemFontOfSize:14*screenH_6]]+10*screenH_6:120*screenW_6) PlaceHodel:@"请输入核销标准"];
        inputTV.backgroundColor = [UIColor colorWithHexString:@"#EFEFF4"];
        inputTV.TextV.backgroundColor =  [UIColor colorWithHexString:@"#EFEFF4"];
        inputTV.TextV.editable = NO;
        [_heXiaoview addSubview:inputTV];
        __weak typeof(self)weakSelf = self;
        inputTV.editBlock = ^(NSString *textStr){
            weakSelf.mbContent = textStr;
            weakSelf.btnsView.mbContent = [ToolViewViewController GetDataStr:weakSelf.mbContent];
        };
        if ([ToolViewViewController isNotNullStr:_mbContent]) {
            inputTV.TextV.text = _mbContent;
        }
        if (_orderStatus == 1) {//审批状态为可编辑
            inputTV.TextV.editable = YES;
        }
       
    }
    return _heXiaoview;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (section == 0)
    {
        return _detailInfoArr.count;
    }
    else if (section == 1)
    {
        if (![_detailModel.remarks isEmptyString] && [_detailModel.approvalType integerValue] == 1) {
            return _recordListArr.count + 1;
        }
        return _recordListArr.count;
    }
    else
    {
        if (_moduleType == HomeModuleTypeOA)
        {
            return _pics.count>0?1:0;
        }
        else
        {
            return 1;
        }
    }
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    if (section == 1)
    {
        return _recordListArr.count > 0 ? 50.0 : 0.0000000001;
    }
    else
    {
        return 0.00001;
    }
}


- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    if(section == 1 && _recordListArr.count>0)
    {
        UIView *headView = [self createHeaderViewWithTitle:@"审批信息"];
        return _recordListArr.count >0 ? headView : [UIView new];;
    }
    else
    {
        return nil;
    }
}

- (UIView *)createHeaderViewWithTitle:(NSString *)title
{
    UIView *headView = [UIView new];
    headView.backgroundColor = [UIColor whiteColor];
    UILabel *lab = [UILabel new];
    lab.text = title;
    lab.textColor = [UIColor blackColor];
    lab.font = KwFont(15);
    [headView addSubview:lab];
    [lab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(headView.mas_left).offset(20);
        make.top.equalTo(headView).offset(15);
        make.height.equalTo(@15);
    }];

    UIView *lineView = [UIView new];
    lineView.frame = CGRectMake(0, 50, self.view.bounds.size.width, 1.5);
    lineView.backgroundColor = KwGaryColor;
    [headView addSubview:lineView];
    return headView;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *doubleLabCell_ID = @"DoubleLabCell";
    static NSString *photoManageCell_ID = @"PhotoManageCell";
    static NSString *recordCell_ID = @"recordCellID";
    if (indexPath.section == 0)
    {
        DoubleLabCell *cell;
        cell = [tableView dequeueReusableCellWithIdentifier:doubleLabCell_ID];
        if (!cell)
        {
            cell = [[DoubleLabCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:doubleLabCell_ID];
        }
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        NSDictionary *dic = _detailInfoArr[indexPath.row];
        NSString *key = [dic allKeys][0];
        cell.constStr = key;
        cell.paraStr = [dic objectForKey:key];
        return cell;

    }
    else if (indexPath.section == 1)
    {

        if (indexPath.row == _recordListArr.count) {
            UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RemarksCell"];
            if (!cell) {
                cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"RemarksCell"];
            }
            cell.textLabel.text = [NSString stringWithFormat:@"拒绝原因：%@", _detailModel.remarks];
            cell.textLabel.numberOfLines = 0;
            cell.textLabel.font = KwFont(14);
            cell.textLabel.textColor = [UIColor grayColor];
            return cell;
        }

        UITableViewCell *cell;
        cell = [tableView dequeueReusableCellWithIdentifier:recordCell_ID];
        if (!cell) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:recordCell_ID];
            if (_recordListArr && _recordListArr.count > 0)
            {
                OtherDetailCheckListModel *model = _recordListArr[indexPath.row];

                UILabel *firstLab = [UILabel new];
                firstLab.textColor = [UIColor grayColor];
                firstLab.numberOfLines = 0;
                firstLab.font = [UIFont systemFontOfSize:14.0];
                firstLab.textAlignment = NSTextAlignmentLeft;
                NSString *str = [NSString stringWithFormat:@"%@,%@,%@",model.userName,model.approvalTime,model.approvalMemo];
                firstLab.text = str;
                [cell addSubview:firstLab];
                [firstLab mas_makeConstraints:^(MASConstraintMaker *make) {
                    make.left.equalTo(@20);
                    make.right.equalTo(@-15);
                    make.top.equalTo(@10);
                    make.bottom.equalTo(@-15);
                }];
            }
        }
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }
    else
    {
        PhotoManageCell *cell;
        cell = [tableView dequeueReusableCellWithIdentifier:photoManageCell_ID];
        if (!cell)
        {
            cell = [[PhotoManageCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:photoManageCell_ID];
        }
        cell.vc = self;
        if (indexPath.section == 2) {
            cell.titleLabel.text = @"照片管理";
            cell.picType = _moduleType == HomeModuleTypeOA?PicTypeOtherFeeAdd:12;
            [cell configCell:_pics];
        }else{
            cell.titleLabel.text = @"票据照片管理";
            cell.picType = PicTypeOtherFeeCheck;
            [cell configCell:_picHXArr];
        }
        cell.orderId = _orderId;
        return cell;
    }
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

}

- (void)onTapLeftBarButton {
    [Singleton shareInstance].noRefresh = YES;
    [self.navigationController popViewControllerAnimated:YES];
}
@end


